package com.example.demo.exception;

import com.example.demo.utils.ResultEnum;

/**
 * Created by Hy on 2018/8/24.
 */
public class CustomException extends RuntimeException{
    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public CustomException(){}
    public CustomException(ResultEnum resultEnum){
        super(resultEnum.getInfo());
        this.code = resultEnum.getCode();
    }

    public CustomException(Integer code,String info){
        super(info);
        this.code = code;
    }
}
